﻿Public Class frmObserver
    Dim detector As New DetectorHumo()


    Private Sub frmObserver_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Output.Print("-------------------------")
        Output.Print("--Patrón Observer:")

        Dim alarm1 As New AlarmaPiso1()
        Dim alarm2 As New AlarmaPiso2()
        Dim alarm3 As New AlarmaPiso3()
        Dim ascensor As New Ascensor()

        detector.agregarObservador(alarm1)
        detector.agregarObservador(alarm2)
        detector.agregarObservador(alarm3)
        detector.agregarObservador(ascensor)
    End Sub

    Private Sub btnActivar_Click(sender As System.Object, e As System.EventArgs) Handles btnActivar.Click
        detector.ActivarAlarmas()
    End Sub

End Class